#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <string>
#include <vector>
#include <unistd.h>
#include <log4cpp/FileAppender.hh>
#include <log4cpp/Category.hh>

using namespace std;
using namespace log4cpp;


int main()
{
    //输出
    FileAppender *appender1 = new FileAppender("fileType", "test_log4cpp.log");
    //绑定格式化器
    appender1->setLayout(new BasicLayout());
    //记录器
    Category &root = Category::getRoot();
    //绑定
    root.setAppender(appender1);
    //设置优先级
    root.setPriority(Priority::DEBUG);

    root.debug("this is a debug message");
    root.info("this is a info message");
    root.alert("this is an alert message");
    root.error("this is an error message");

    //delete appender1;
    return 0;
}

